home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX 6.2 Applications 1996 May
/
SGI IRIX 6.2 Applications 1996 May.iso
/
dist
/
impr_dev.idb
/
usr
/
impressario
/
doc
/
gui_model.spec.z
/
gui_model.spec
Wrap
Text File
|
1996-05-06
|
9KB
|
206 lines
GRAPHICAL MODEL FILE SPECIFICATION
$Revision: 1.15 $
$Date: 1996/01/26 17:41:05 $
Overview
Silicon Graphics printing technology includes a graphical print job submittal
Motif compatible widget, the PrintBox. The PrintBox widget is contained in the
library, libprintui. Applications such as glp use the PrintBox widget to
provide their printing capabilities. In addition to providing graphical
selection of System V print job submittal options, the PrintBox provides a
mechanism for graphical selection of printer specific options. This mechanism
is the graphical model file. Graphical model files, also referred to as
graphical options panels and gui_models, provide the printer vendor and driver
developer a means to showcase the unique features of a printer in a
visually-appealing graphical mode. The graphical model file program is easily
integrated into the PrintBox widget. This specification provides the
information necessary to create a graphical model file and integrate it into
SGI's printing technology.
Graphical model files are standalone executable programs. These programs
are stored in a standard directory known to the PrintBox widget.
The graphical model files are thus automatically available to users of the
SGI printing tools that use the PrintBox widget (e.g. glp and Insight). The
rules for developing a graphical model file are straightforward and do not
require any interprocess communication or similar complex procedures.
Layout
Typically a graphical model file consists of a single window. This window
usually contains two main sections, an option section and an action area.
The option section contains all printer-specific option controls. This area
is often divided into groups of option controls, where each group represents
a specific print file type. Most option areas contain controls for text files,
SGI image format files, PostScript files and a general options section. Since
there are often a large number of controls in the option section, a scrolled
window should be used to keep the graphical model file window to a reasonable
size.
The action area is located at the bottom of the graphical model file window and
consists of a number of push buttons. At a minimum, the graphical model file
must include these three action area buttons:
o OK - output option string to stdout and terminate program.
o Apply - output option string to stdout but do not terminate program.
o Cancel - terminate program without any option string output.
The following buttons may be include at the developer's discretion:
o Help - provide printer specific options help.
Buttons should be grouped together on the right side of the action area. The
width of all buttons should be equal. The leftmost buttons should be OK
followed by Apply, Cancel and Help. Any additional buttons should be placed
between the Apply and Cancel buttons.
Options Handling
When the OK or Apply buttons are activated, the graphical model file program
must form a valid System V printer option string based on its GUI settings and
print this string to its standard output (stdout).
If printer specific options have been passed to the graphical model file on the
command-line, the program must interpret those options and initialize its
option area controls to reflect these command-line options. Those options
that are not recognized by the graphical model file must be preserved and
prepended to the output option string.
Graphical Model File Development
The graphical model file should be created with the OSF/Motif UI toolkit.
As of Impressario 1.2 a graphical model file can have its own application
resource file. While the resource file can be given any name, it is highly
recommended that the name represent the printer model name and have
its first letter capitalized. For example, the application resource file for
the HP LaserJet graphical model file is called LaserJet. The name chosen
for the resource file must be specified in the gui_class.h header file and
must also be specified in the printer model file as the value of the GUI_CLASS
variable. The resource file should be installed in the directory
/usr/lib/X11/app-defaults.
To match the look and feel of the PrintPanel program (a.k.a glp) and other
graphical options panels, the application resource file should include the
following resources:
*useSchemes: all
*schemeFileList: SgiSpec
*sgiMode: True
To facilitate localization of the option panel for international customers,
all label strings and messages should be placed in the application resource
file rather than being hard coded into the program.
The graphical model file must consist of a single executable program and its
application resource file. The graphical model files are restricted to a
single executable and resource file because the printer installation tools
install only these two files during network printer installation.
Graphical Model File Naming
The graphical model file must be given the exact same name as its printer's
model file, followed by the suffix .gui. For example, if the printer model
file for an HP DeskJet 500C printer is called dj500c_model, then the graphical
model file must be given the name dj500c_model.gui. If the graphical model
file is given a name which differs from the model file name, the graphical
model file will not be installed when a new printer is installed on a system.
The application resource file for the graphical model program should be given
a name representative of the printer's model name (e.g. LaserJet). Typically,
the first letter of the resource filename is capitalized. The name of the
resource file must be specified in the gui_class.h file as the value of the
GUI_CLASS define and in the printer model file as the value of the GUI_CLASS
variable.
Installation
Graphical model file programs must be installed in the directory
/var/spool/lp/gui_model/ELF.
The printer installation software looks in the above directories for
graphical model file programs. The executable should be owned by lp
and should be a member of the group lp. The executable should be
given 0755 file permissions.
Graphical model file programs should be compiled on Irix 5.3 (or
higher) to support Impressario versions 2.0 (and higher).
The application resource file for the program should be installed
into /usr/lib/X11/app-defaults. The file should be given 0644
permissions and should be owned by the root user and sys group.
Invocation by the PrintBox widget
Typically the graphical model file is invoked by the PrintBox widget. The
graphical model file will always be invoked with the following command line
arguments:
argv[0] printer name
argv[1] user name
argv[2] filename(s) string
argv[3] printer-specific option string (optional)
argv[4-n] Xt options (optional)
Note that any Xt options must be specified as argv[4] or greater. If there
are no printer-specific options for argv[3], the empty string ("") will be
passed as argv[3]. Similarly, if no filenames are specified, the empty
string will be passed as argv[2].
You must use the printer name (i.e. argv[0]) as the instance name of the
application. This is done automatically if the main program from the
sample graphical model source code is used. The PrintBOx widget will not
recognize that the graphical model program has appeared on the screen if
the graphical model program is not given the printer name as its instance
name.
Standalone Invocation
To test a graphical model file during development, it may be run as a
standalone executable from the UNIX command line. Invoke the graphical
model file by entering:
[executable name] [any valid username] ""
For example, if the executable program is called dj500c_model.gui, and "joe" is
a valid username on the system, then the program can be executed from the
command line by typing:
dj500_model.gui joe ""
If the application resource file is located only in the current directory,
the environment variable XUSERFILESEARCH path should have a '%N' prepended
to it so that resource files are looked for in the current directory. Doing
this will ensure that the graphical model file program finds its resource
file in the current directory.
Termination by the PrintBox
When the application using the PrintBox widget terminates the graphical model
file will be sent a SIGTERM or a SIGHUP. The graphical model file should exit
upon receipt of either of these signals. This is the default behavior for
these signals.
Example Code
Example source code for graphical model files can be found on-line in the
directory /usr/impressario/src/gui_models.